<?php
	require_once(realpath(dirname(__FILE__)) . "/Baseobj.class.php");
	require_once(realpath(dirname(__FILE__)) . "/Declidispdesc.class.php");

	// Classe Activite

	// id --> identifiant activite
	// desc --> nom de l'activité

	class Declidisp extends Baseobj{

		var $id;
		var $declinaison;



		const TABLE="declidisp";
		var $table=self::TABLE;

		var $bddvars = array("id", "declinaison");

		function __construct($id = 0){
			parent::__construct();

			if($id > 0)
 			  $this->charger($id);
		}

		function charger($id){
			return $this->getVars("select * from $this->table where id=\"$id\"");

		}

		function delete($requete){
				$resul = mysql_query($requete, $this->link);
				CacheBase::getCache()->reset_cache();
		}


		function supprimer(){
			$declidispdesc =  new Declidispdesc();
			$declidisp =  new Declidisp();

			$this->delete("delete from $declidispdesc->table where declidisp=\"$this->id\"");
			$this->delete("delete from $this->table where id=\"$this->id\"");

			return 1;

		}

	}

?>